<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<script type="text/javascript">
	$(function() {
		$("#writeFileBtn").click(function() {
			//alert("ddd");
			location.href = "${initParam.root}/board_goInsertFileBoard.do";
		});
		var table1 = $("table").ariaSorTable({
			rowsToShow : 10,
			pager : true,
			onInit : function() {
				demoControl();
			},
			colsToHide : {
				1 : true,
				7 : true
			}
		});
		$("#destroy").click(function(event) {
			table1.ariaSorTable('destroy');
		});
		$("#disable").click(function(event) {
			table1.ariaSorTable('disable');
		});

		// add themeswitcher
		var ts = $(
				'<div class="ui-button ui-widget ui-state-default ui-corner-all" style="font-size: 0.7em; padding: 5px; position: absolute; top: 20px; right: 10px;">Click here to add Themeswitcher!</div>')
				.appendTo('body')
				.bind(
						"click",
						function() {
							ts.text("Loading Themeswitcher...");
							$
									.getScript(
											'http://ui.jquery.com/applications/themeroller/themeswitchertool/',
											function() {
												ts
														.removeClass(
																"ui-button ui-widget ui-state-default ui-corner-all")
														.text("").unbind(
																"click")
														.themeswitcher();
											});
						});
	});
</script>
<link href="${initParam.root}/css/style.css" rel="stylesheet" />
</head>
<body>
	<center>
		<h2>자료실</h2>
		<c:if test="${sessionScope.mvo != null }">
			<table>
				<thead>
					<tr>
						<th
							class="ui-table-asc ui-state-active ui-table-number ui-state-default"
							style="width: 2em;"><a href="#server_site_order">NO</a></th>
						<th class="ui-table-number ui-state-default"
							style="min-width: 10em;"><a href="#server_site_order">123123</a></th>
						<th class="ui-table-number ui-state-default"
							style="min-width: 20em;"><a href="#server_site_order">글제목</a></th>
						<th class="ui-table-number-de ui-state-default"
							style="width: 7em;">아이디</th>
						<th class="ui-table-number ui-state-default" style="width: 6em;" a><a
							href="#server_site_order">날짜</a></th>
						<th class="ui-table-date-de ui-state-default" style="width: 6em;"><a
							href="#server_site_order">조회수</a></th>
					</tr>
				</thead>
				<tbody>
					<c:forEach items="${requestScope.list }" var="list">
						<tr>
							<td>${list.fileNo }</td>
							<td></td>
							<td><a
								href="${initParam.root}/board_fileView.do?fileNo=${list.fileNo }&fileCount=${list.fileCount+1 }">${list.fileTitle}</a></td>
							<td>${list.fileWriter }</td>
							<td>${list.fileDate }</td>
							<td>${list.fileCount }</td>
						</tr>
					</c:forEach>
				</tbody>
			</table>
		</c:if>

		<c:if test="${sessionScope.mvo == null }">
			<table>
				<thead>
					<tr>
						<th
							class="ui-table-asc ui-state-active ui-table-number ui-state-default"
							style="width: 2em;"><a href="#server_site_order">NO</a></th>
						<th class="ui-table-number ui-state-default"
							style="min-width: 10em;"><a href="#server_site_order">123123</a></th>
						<th class="ui-table-number ui-state-default"
							style="min-width: 20em;"><a href="#server_site_order">글제목</a></th>
						<th class="ui-table-number-de ui-state-default"
							style="width: 7em;">아이디</th>
						<th class="ui-table-number ui-state-default" style="width: 6em;" a><a
							href="#server_site_order">날짜</a></th>
						<th class="ui-table-date-de ui-state-default" style="width: 6em;"><a
							href="#server_site_order">조회수</a></th>
					</tr>
				</thead>
				<tbody>
					<c:forEach items="${requestScope.list }" var="list">
						<tr>
							<td>${list.fileNo }</td>
							<td></td>
							<td>${list.fileTitle}</td>
							<td>${list.fileWriter }</td>
							<td>${list.fileDate }</td>
							<td>${list.fileCount }</td>
						</tr>
					</c:forEach>
				</tbody>
			</table>
		</c:if>

		<c:if test="${sessionScope.mvo != null }">
			<input type="button" value="글쓰기" id="writeFileBtn">
		</c:if>
	</center>
</body>
</html>